﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Xww.LCV.Model {
    public static class LinkedListTool2 {
        public static string ToString<T>(this LinkedList<T> LinkList, string separator) {
            StringBuilder rst = new StringBuilder();
            var node = LinkList.First;
            while (node != null) {
                rst.AppendFormat("{0}{1}", node.Value, separator);
                node = node.Next;
            }
            return rst.ToString();
        }
        public static bool CheckNextNodeNull<T>(this LinkedListNode<T> node, int steps) {
            if (node == null) return false;
            for (int i = 0; i < steps; i++) {
                node = node.Next;
                if (node == null) return false;
            }
            return true;
        }
    }
}
